package com.test.deencredit.util_deencredit;

import android.provider.Settings;
import android.text.TextUtils;

import com.test.deencredit.base_deencredit.BaseApplication_deencredit;
import com.test.deencredit.config_deencredit.Constant_deencredit;

import org.jetbrains.annotations.NotNull;


public class DecUtil_deencredit {

    private static class InnerDeviceHelper_deencredit {
        private static final DecUtil_deencredit instance_deencredit = new DecUtil_deencredit();
    }

    public static DecUtil_deencredit getInstance_deencredit() {
        return InnerDeviceHelper_deencredit.instance_deencredit;
    }

    @NotNull
    public static String getPackageName_deencredit() {
        String pckName = BaseApplication_deencredit.getInstant().getPackageName();
        if (TextUtils.isEmpty(pckName)) {
            pckName = Constant_deencredit.PACKAGE_NAME;
        }
        return pckName;
    }

    @NotNull
    public String getAndroidID_deencredit() {
        String androidID = Settings.System.getString(BaseApplication_deencredit.getInstant().getContentResolver(), Settings.Secure.ANDROID_ID);
        if (TextUtils.isEmpty(androidID)) {
            return System.currentTimeMillis() + "";
        }
        if (androidID.contains("00000000")) {
            return System.currentTimeMillis() + "";
        }
        return androidID;
    }

}
